// Copyright (c) 2022 CHANGLEI. All rights reserved.

import 'package:aircraft_war/commons/constants.dart';
import 'package:aircraft_war/generated/assets.dart';
import 'package:flame/components.dart';
import 'package:flame/flame.dart';

/// Created by changlei on 2022/5/18.
///
/// logo
class LogoText extends PositionComponent {
  @override
  Future<void> onLoad() async {
    await add(SpriteComponent(
      sprite: Sprite(Flame.images.fromCache(Images.shoot_copyright)),
      size: logoTextSize,
    ));
  }

  /// 布局
  void layout(Vector2 parentSize) {
    size = logoTextSize;
    anchor = Anchor.topCenter;
    position = Vector2(parentSize.x / 2, 80);
  }
}
